package com.tyk.bookstore.back.system.valid.constant;

import java.util.regex.Pattern;

/**
 * @author tyk
 * @description MenuFieldValidConstant
 */
public class MenuFieldValidConstant {
    /**
     * 路由名称
     */
    public static final int NAME_MIN_LENGTH = 1;
    public static final int NAME_MAX_LENGTH = 40;
    public static final String NAME_REGEXP = "^[\\w_-]{1,40}$";
    public static final Pattern NAME_PATTERN = Pattern.compile(NAME_REGEXP);

    /**
     * 路由名称(模糊)
     */
    public static final int NAME_LIKE_MIN_LENGTH = 1;
    public static final int NAME_LIKE_MAX_LENGTH = 40;
    public static final String NAME_LIKE_REGEXP = "^[\\w_-]{1,40}$";
    public static final Pattern NAME_LIKE_PATTERN = Pattern.compile(NAME_REGEXP);

    /**
     * 路由路径、路由重定向路径，组件路径
     */
    public static final int PATH_MIN_LENGTH = 1;
    public static final int PATH_MAX_LENGTH = 100;
    public static final String PATH_REGEXP = "^[\\w./-]{1,100}$";
    public static final Pattern PATH_PATTERN = Pattern.compile(PATH_REGEXP);


    /**
     * 菜单名称
     */
    public static final int TITLE_MIN_LENGTH = 1;
    public static final int TITLE_MAX_LENGTH = 100;
    public static final String TITLE_REGEXP = "^[\\S]{1,100}$";
    public static final Pattern TITLE_PATTERN = Pattern.compile(TITLE_REGEXP);

    /** 菜单名称(模糊) */
    public static final int TITLE_LIKE_MIN_LENGTH = 1;
    public static final int TITLE_LIKE_MAX_LENGTH = 100;
    public static final String TITLE_LIKE_REGEXP = "^[\\S]{1,100}$";
    public static final Pattern TITLE_LIKE_PATTERN = Pattern.compile(TITLE_LIKE_REGEXP);

    /**
     * 菜单图标
     */
    public static final int ICON_MIN_LENGTH = 1;
    public static final int ICON_MAX_LENGTH = 40;
    public static final String ICON_REGEXP = "^[\\w-]{1,40}$";
    public static final Pattern ICON_PATTERN = Pattern.compile(ICON_REGEXP);
}
